{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9702b995",
   "metadata": {},
   "outputs": [],
   "source": [
    "import getpass\n",
    "hide_card = int(getpass.getpass(\"hide_card:\"))\n",
    "count = 0 \n",
    "# print(hide_card)\n",
    "if hide_card <100 and hide_card>0:\n",
    "    print(\"游戏开始\")\n",
    "    while True:\n",
    "        if count <5:\n",
    "            guess_digit = int(input(\"guess_digit:\")) #玩游戏的人\n",
    "            if guess_digit == hide_card:\n",
    "                print(\"yes ,you got it.\")\n",
    "                break\n",
    "            elif guess_digit > hide_card:\n",
    "                print(\"往小了想想。\")\n",
    "            else:\n",
    "                print(\"往大了猜\")\n",
    "            count = count+1\n",
    "        else:\n",
    "            print(\"猜这么多次都不对，你个笨蛋！\")\n",
    "            print(\"正确答案是：%s\"%hide_card)\n",
    "            break\n",
    "else:\n",
    "    print(\"请输入数字在0-99之间。不要耍赖！\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d724c246",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
